<?php

/**
 * Model for users DB table, fields: id, name, profile_url, age
 *
 * @author Michael Elfimov (www.elfimov.com)
 */

class User_Model extends ORM {
	
	/**
	 * Create row represents users
	 *
	 * @param integer $id User ID
	 * @param string $name Full Name
	 * @param string $profileUrl Profile URL
	 * @param integer $age Age in years
	 * @return Object Newly created data object
	 */
	public static function create($id, $name, $profileUrl, $age) {
		$dbUser = ORM::factory('user');

		$dbUser->id = $id;
		$dbUser->name = $name;
		$dbUser->profile_url = $profileUrl;
		$dbUser->age = $age;

		$dbUser->save();
		
		return $dbUser;
	}

}
